package com.pet.server.po;

import java.sql.Timestamp;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Formula;

/**
 * 
 * @author Administrator
 *
 */
@Entity
@Table(name = "pet_missing")
public class PetMissing implements java.io.Serializable {

	// Fields

	private Integer missId;
	private Integer userId;
	private Double longitude;
	private Double latitude;
	private String city;
	private String area;
	private String petCate;
	private String feature;
	private String sex;
	private String age;
	private String breed;
	private String icoPath;
	private Date createTime;
	private Date missDate;
	private String phone;
	private String qq;
	private String state;
	private String description;
	private String nickName;


	// Constructors

	/** default constructor */
	public PetMissing() {
	}

	/** minimal constructor */
	public PetMissing(Date createTime) {
		this.createTime = createTime;
	}

	/** full constructor */
	public PetMissing(Integer missId,Integer userId,Double longitude,Double latitude,String city,String area,
	String petCate,String feature, String sex,String age,String breed,String icoPath,Date createTime,Date missDate,
	String phone,String qq,String state,String description) {
		this.missId = missId;
		this.userId = userId;
		this.longitude = longitude;
		this.latitude = latitude;
		this.city = city;
		this.area = area;
		this.petCate = petCate;
		this.feature = feature;
		this.sex = sex;
		this.age = age;
		this.breed = breed;
		this.icoPath = icoPath;
		this.createTime = createTime;
		this.missDate = missDate;
		this.area = area;
		this.phone = phone;
		this.qq = qq;
		this.state = state;
		this.description = description;
		
	}
	
	/**
	 * @return the missId
	 */
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "miss_id", unique = true, nullable = false)
	public Integer getMissId() {
		return missId;
	}

	/**
	 * @param missId the missId to set
	 */
	public void setMissId(Integer missId) {
		this.missId = missId;
	}

	/**
	 * @return the userId
	 */
	@Column(name = "user_id", length = 11)
	public Integer getUserId() {
		return userId;
	}

	/**
	 * @param userId the userId to set
	 */
	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	/**
	 * @return the longitude
	 */
	@Column(name = "longitude", length = 32)
	public Double getLongitude() {
		return longitude;
	}

	/**
	 * @param longitude the longitude to set
	 */
	
	public void setLongitude(Double longitude) {
		this.longitude = longitude;
	}

	/**
	 * @return the latitude
	 */
	@Column(name = "latitude", length = 32)
	public Double getLatitude() {
		return latitude;
	}

	/**
	 * @param latitude the latitude to set
	 */
	public void setLatitude(Double latitude) {
		this.latitude = latitude;
	}

	/**
	 * @return the city
	 */
	@Column(name = "city", length = 20)
	public String getCity() {
		return city;
	}

	/**
	 * @param city the city to set
	 */
	public void setCity(String city) {
		this.city = city;
	}

	/**
	 * @return the area
	 */
	@Column(name = "area", length = 256)
	public String getArea() {
		return area;
	}

	/**
	 * @param area the area to set
	 */
	public void setArea(String area) {
		this.area = area;
	}
	
	/**
	 * @return the petCate
	 */
	@Column(name = "pet_cate", length = 20)
	public String getPetCate() {
		return petCate;
	}

	/**
	 * @param petCate the petCate to set
	 */
	public void setPetCate(String petCate) {
		this.petCate = petCate;
	}

	/**
	 * @return the feature
	 */
	@Column(name = "feature", length = 64)
	public String getFeature() {
		return feature;
	}

	/**
	 * @param feature the feature to set
	 */
	public void setFeature(String feature) {
		this.feature = feature;
	}

	/**
	 * @return the sex
	 */
	@Column(name = "sex", length = 8)
	public String getSex() {
		return sex;
	}

	/**
	 * @param sex the sex to set
	 */
	public void setSex(String sex) {
		this.sex = sex;
	}

	/**
	 * @return the breed
	 */
	@Column(name = "breed", length = 20)
	public String getBreed() {
		return breed;
	}

	/**
	 * @param breed the breed to set
	 */
	public void setBreed(String breed) {
		this.breed = breed;
	}

	/**
	 * @return the icoPath
	 */
	
	@Column(name = "ico_path", length = 128)
	public String getIcoPath() {
		return icoPath;
	}

	/**
	 * @param icoPath the icoPath to set
	 */
	public void setIcoPath(String icoPath) {
		this.icoPath = icoPath;
	}

	/**
	 * @return the createTime
	 */
	
	@Column(name = "create_time", nullable = false, length = 0)
	public Date getCreateTime() {
		return createTime;
	}

	/**
	 * @param createTime the createTime to set
	 */
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	/**
	 * @return the missDate
	 */
	
	@Column(name = "miss_date", nullable = false, length = 0)
	public Date getMissDate() {
		return missDate;
	}

	/**
	 * @param missDate the missDate to set
	 */
	public void setMissDate(Date missDate) {
		this.missDate = missDate;
	}

	/**
	 * @return the phone
	 */
	
	@Column(name = "phone", length = 20)
	public String getPhone() {
		return phone;
	}

	/**
	 * @param phone the phone to set
	 */
	public void setPhone(String phone) {
		this.phone = phone;
	}

	/**
	 * @return the qq
	 */
	@Column(name = "qq", length = 16)
	public String getQq() {
		return qq;
	}

	/**
	 * @param qq the qq to set
	 */
	public void setQq(String qq) {
		this.qq = qq;
	}

	/**
	 * @return the state
	 */
	@Column(name = "state", length = 1)
	public String getState() {
		return state;
	}

	/**
	 * @param state the state to set
	 */
	
	public void setState(String state) {
		this.state = state;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description the description to set
	 */
	
	@Column(name = "description", length = 256)
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @return the age
	 */
	@Column(name = "age", length = 10)
	public String getAge() {
		return age;
	}

	/**
	 * @param age the age to set
	 */
	public void setAge(String age) {
		this.age = age;
	}

	
	@Formula("(SELECT f.nick_name FROM user_info f WHERE f.user_id=user_id)")
	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
	
	
}